Skip to content

Conversation

zirkelc
Copy link
Contributor

@zirkelc zirkelc commented Mar 7, 2025

Serverless currently doesn't support loading serverless.ts ESM files with export default { }. I submitted this PR serverless/serverless#11147 a long time ago, but they didn't go further with it because ESM in Node.js was not stable back then. It is stable now, but I think they wanted to support it only in v4.

Nevertheless, the original PR implemented the ESM+TS support in a hacky way with an intermediate script and a sub-process. Meanwhile I found a much better way using jiti and it is documented here: https://github.com/zirkelc/serverless-esm-ts

This PR implements it in the same way and replaces the old outdated ts-node for loading TypeScript configs.

@mnapoli
Copy link
Contributor

mnapoli commented Mar 7, 2025

That looks awesome!

The linting is failing though, are you able to look at it?

@zirkelc
Copy link
Contributor Author

zirkelc commented Mar 7, 2025

Should be fixed now

@zirkelc
Copy link
Contributor Author

zirkelc commented Mar 8, 2025

I will fix the new linting errors 😅

@mnapoli
Copy link
Contributor

mnapoli commented Mar 9, 2025

Year the rules on the repo are very strict 😅

@mnapoli
Copy link
Contributor

mnapoli commented Mar 9, 2025

Thank you!

@mnapoli mnapoli merged commit 6e1a0d8 into oss-serverless:main Mar 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants